home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 011a / 1000_qm.zip / 1000-QM.SLT next >
Text File  |  1993-06-06  |  5KB  |  166 lines

  1. //
  2. // This is a Telix script for automatic up/downloading of .QWK and
  3. // .REP mail packets via the Qmail mail door. It will will logon and
  4. // then take you into the Qmail door, upload your .REP reply file
  5. // and then delete it, and then "cycle" to the next command prompt
  6. // and download your QWK packet file.
  7. //
  8. // If no REP file is found, the script will instead Download your
  9. // QWK packet.
  10. //
  11. // When the script sees the "receive these messages (Y/N)?" message
  12. // at the end of downloading it will stop and return Telix to manual
  13. // operation. If no messages are found, simply hit ESC to stop
  14. // the script.
  15. //
  16. // Only 2 types of entries are required in this script file ...
  17. // user name & REP file location/name. Be sure there is a Semicolon
  18. // at the end of the name & REP statement too.
  19. //
  20. // Type your name in between the str name[] =  qoutes. (Line 40)
  21. //                               ^^^^^^^^^^^^
  22. // Type in the drive/dir/xxxxxxxx.rep in between the
  23. // str file_name[] =  qoutes.  (Line 41)
  24. // ^^^^^^^^^^^^^^^^^
  25. //
  26. // Next, this file must then be compiled with the Telix CS.EXE
  27. // compiler to be used with Telix AND the 1000-QM.SLC filename
  28. // inserted in the "Linked script" entry in the phone book.
  29. //
  30. // Your password must also be inserted in the "Password" entry in
  31. // the phone book as well.
  32. //
  33. // To compile the script ... type  CS 1000-QM. Both files must be in
  34. // the same disk location.
  35. //
  36. // Copy the newly compiled  1000-QM.SLC  file to the Telix location.
  37. //
  38. ///////////////////////////////////////////////////////////////////////
  39.  
  40. str name[] = "FIRST LAST";
  41. str file_name[] = "drive\directory\1000bbs.rep";
  42.  
  43. ///////////////////////////////////////////////////////////////////////
  44.  
  45. main()
  46.  
  47. {
  48.  int stat;                              // initiate track var
  49.  int t1,                                // initiate individual
  50.      t2,                                // track variables
  51.      t3,
  52.      t4,
  53.      t5,
  54.      t6,
  55.      t7,
  56.      t8,
  57.      t9;
  58.  
  59. ///////////////////////////////////////////////////////////////////////
  60.  
  61.  alarm (2);                             // sound a connect
  62.                                         // alarm, 2 secs
  63.  
  64. // definitions of what strings to track. 0 is case sensitive on. 1 is off.
  65.  
  66.  t1 = track ("Language # to use (Enter)=no change?", 1);
  67.  t2 = track ("graphics (Enter)=no?", 1);
  68.  t3 = track ("your first name?", 0);
  69.  t4 = track ("Password (Dots will echo)?", 0);
  70.  t5 = track ("More?", 0);
  71.  t6 = track ("Since 'Last Read' (Enter)=yes?", 0);
  72.  t7 = track ("Main Board Command?", 1);
  73.  t8 = track ("Qmail Command?", 0);
  74.  t9 = track ("receive these messages (Y/N)?", 0);
  75.  
  76. ///////////////////////////////////////////////////////////////////////
  77.  
  78.  while (1)
  79.  {
  80.    terminal();                          // let Telix process any
  81.                                         // chars and keys
  82.  
  83.    stat = track_hit(0);                 // see which (if any) track
  84.                                         // was hit
  85.  
  86. ///////////////////////////////////////////////////////////////////////
  87.  
  88.    if (stat == t1)                      // Language # to use
  89.     {
  90.      delay(10);                         // wait 1 second
  91.      cputs("2");                        // send defined string
  92.      cputc('^M');                       // send Carriage Return
  93.      track_free(t1);                    // free track handle (turn off)
  94.     }
  95.    else if(stat == t2)                  // Graphics
  96.     {
  97.      delay(10);
  98.      cputs("N Q");
  99.      cputc('^M');
  100.      track_free(t2);
  101.     }
  102.    else if(stat == t3)                  // Name
  103.     {
  104.      delay(10);
  105.      cputs(name);
  106.      cputc('^M');
  107.      track_free(t3);
  108.     }
  109.    else if(stat == t4)                  // Send password
  110.     {
  111.      delay(10);
  112.      cputs(_entry_pass);
  113.      cputc('^M');
  114.      track_free(t4);
  115.     }
  116.    else if(stat == t5)                  // More?
  117.     {
  118.      delay(10);
  119.      cputs("N");
  120.      cputc('^M');
  121.     }
  122.    else if(stat == t6)                  // Scan message base?
  123.     {
  124.      delay(10);
  125.      cputs("N");
  126.      cputc('^M');
  127.      track_free(t6);
  128.      }
  129.    else if(stat == t7)                  // Main Board Command
  130.     {
  131.      delay(10);
  132.      cputs("OPEN 3");
  133.      cputc('^M');
  134.      track_free(t7);
  135.      }
  136.    else if(stat == t8)                  // Check for .REP packet file &
  137.     {                                   // upload OR if not avail, download
  138.     delay(10);                          // QWK packet file via Qmail Command
  139.     if(filefind(file_name, 0))          // prompt.
  140.     {
  141.     delay(10);
  142.     cputs("U");
  143.     cputc('^M');
  144.     send('Z', file_name);
  145.     delay(10);
  146.     fdelete(file_name);
  147.     }
  148.    else
  149.     {
  150.     delay(10);
  151.     cputs("D");                         // Download QWK packet.
  152.     cputc('^M');
  153.     track_free(t8);
  154.      }
  155.      }
  156.    else if(stat == t9)                  // receive these messages (Y/N)?
  157.     {
  158.      delay(10);
  159.      cputs("Y");
  160.      cputc('^M');
  161.      break;                             // done with script.
  162.     }
  163.     }
  164.     }
  165.  
  166.